package org.jsbd.boss.service.impl;

import java.util.List;
import java.util.Map;

import org.jsbd.boss.common.DataGridModel;
import org.jsbd.boss.dao.IMonitorConfigDao;
import org.jsbd.boss.dao.IMonitorParamTimingDAO;
import org.jsbd.boss.domian.MonitorConfigBean;
import org.jsbd.boss.domian.MonitorParam;
import org.jsbd.boss.domian.MonitorParamVO;
import org.jsbd.boss.service.IMonitorParamTimingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("monitorParamTimingService")
public class MonitorParamTimingServiceImpl implements IMonitorParamTimingService {

	@Autowired
	private IMonitorParamTimingDAO monitorParamTimingDAO;
	@Autowired
	private IMonitorConfigDao monitorConfigDao;
	
	@Override
	public Map<String, Object> findDataWithPage(DataGridModel page, MonitorParamVO mvo) {
		return monitorParamTimingDAO.findDataWithPage(page, mvo);
	}

	@Override
	public void save(MonitorParam monitorParam) {
		monitorParamTimingDAO.insert(monitorParam);
	}

	@Override
	public void delete(Integer id) {
		monitorParamTimingDAO.delete(id);
	}

	@Override
	public List<MonitorParam> findDeltaData(int offset) {
		return monitorParamTimingDAO.selectDeltaData(offset);
	}

	@Override
	public void updateBatch(List<MonitorConfigBean> monitorConfigBeans, List<MonitorParam> monitorParams) {
		monitorConfigDao.updateItemValue(monitorConfigBeans);
		monitorParamTimingDAO.updateIsExecute(monitorParams);
	}

	@Override
	public MonitorParam findMonitorParamById(Integer id) {
		return monitorParamTimingDAO.findMonitorParamById(id);
	}

	@Override
	public void modifyMonitorParam(MonitorParam monitorParam) {
		monitorParamTimingDAO.modifyMonitorParam(monitorParam);
	}

}
